#include"process.h"
#include<string.h>
#define NUM 102
#define Style '='
#define GREEN "\033[0;32;32m"
#define NONE "\033[m"

const char* label="/-||";

void process()
{
  char bar[NUM];
  memset(bar,'\0',sizeof(bar));

  int len =strlen(label);//不包含 /0的大小；
  
  int cnt=0;

  while(cnt<=100)
  {
    printf(GREEN"[%-100s]"NONE"[%3d%%] [%c]\r", bar, cnt,label[cnt%len]);
    fflush(stdout);
    bar[cnt++]=Style;
    if(cnt<100)
    {
    bar[cnt]='>';
    }
    usleep(50000);
  }
 printf("\n");

}
